package atm;

import javax.swing.*;
import java.awt.*;

public class ATMFrame extends JFrame {
    private Image bgImage = new ImageIcon("images/background.jpg").getImage();

    private LoginPanel loginPanel = new LoginPanel();
    private MenuPanel menuPanel = new MenuPanel();
    private SavePanel savePanel=new SavePanel();
    private CardLayout cardLayout = new CardLayout();
    private GetPanel   getPanel=new GetPanel();
    private TransferPanel transferPanel=new TransferPanel();
    private SearchPanel searchPanel=new SearchPanel();
    private ChangePwdPanel changePwdPanel=new ChangePwdPanel();
    public ATMFrame(){
        this.setContentPane(new JPanel(){
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                g.drawImage(bgImage,0,0,this);
            }
        });
        this.add("change",changePwdPanel);
       // this.add("search",searchPanel);
       // this.add("transfer",transferPanel);
       // this.add("get",getPanel);
        this.setLayout(cardLayout);
//         this.add("save",savePanel);
//        this.add("login",loginPanel);
//        this.add("menu",menuPanel);
        this.setSize(1024,768);
        this.setTitle("ATM");
        this.setResizable(false);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new ATMFrame();
    }
}
